package com.sy.shopping.controller;

import com.sy.shopping.service.UserAService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.HashMap;

@RestController
@RequestMapping("users")
@Slf4j
public class UserAController {
    @Resource
    private UserAService userAService;

    /**
     * 判断用户名
     */
    @GetMapping("/_user")
    public Object getUserAByUsername(@RequestParam String username){
        return userAService.getUserAByUsername(username);
    }

    /**
     * 登录
     */
    @PostMapping("/login")
    public Object verifyUserAPassword(@RequestBody HashMap<String,Object> input){
        log.info("input:"+input);
        return userAService.verifyUserAPassword(input);
    }
}
